package org.karelun.gef.property;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.karelun.gef.helper.IDConstant;
import org.karelun.gef.helper.ImageResource;

public class PropertyLabelProvider extends LabelProvider {

	private String type;

	public PropertyLabelProvider(String type) {
		this.type = type;
	}

	public Image getImage(Object element) {
		if (element instanceof String) {
			if (IDConstant.Name_prop.equals(type)){
				return ImageResource.getImage(ImageResource.PROP_NAME);
			}else if(IDConstant.Constraint_prop.equals(type))
				return ImageResource.getImage(ImageResource.PROP_CONSTRAINT);
		}
		return super.getImage(element);
	}
}
